home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / PASCSRC.ZIP / LOOPIF.PAS < prev    next >
Pascal/Delphi Source File  |  1988-01-15  |  628b  |  18 lines

  1.                                 (* Chapter 4 - Program 3 *)
  2. program Loops_And_Ifs;
  3.  
  4. var Count,Index : integer;
  5.  
  6. begin (* Main program *)
  7.    for Count := 1 to 10 do begin (* Main loop *)
  8.       if Count < 6 then
  9.          Writeln('The loop counter is up to ',Count:4);
  10.       if Count = 8 then begin
  11.          for Index := 8 to 12 do begin (* Internal loop *)
  12.             Write('The internal loop index is ',Index:4);
  13.             Write(' and the main count is ',Count:4);
  14.             Writeln;
  15.          end; (* Internal loop *)
  16.       end; (* if Count = 8 condition *)
  17.    end; (* Main loop *)
  18. end.  (* Main program *)